#pragma once

#include "Plane.h"
#include "Ray.h"

class CCamera;
class AFX_CLASS_EXPORT CTranslationManager
{
public:
	typedef enum TransType{
		TRANS_ALONG_LINE	= 0,
		TRANS_ON_PLANE		= 1
	};

	CTranslationManager(void);
	CTranslationManager(const CCamera* const pCamera);
	~CTranslationManager(void);

	void setPlane(const CPlane& plane);
	const CPlane& getPlane();
	bool setLine(const CRay& line);
	const CRay& getLine();
	void setCamera(const CCamera* const pCamera);
	const CCamera* const getCamera();

	//
	void startFrom(int mouseX, int mouseY);
	CVector3D moveTo(int mouseX, int mouseY);

private:
	CCamera		*m_pCamera;

	//
	TransType	m_transType;
	CPlane		m_plane;
	CRay		m_line;

	CRay		m_projRay;
	CPoint3D	m_curPoint;
	CPoint3D	m_prevPoint;
	CVector3D	m_transVector;
	bool		m_bLocked;
};
